<!DOCTYPE html>
<html lang="en">
<head>
    <!--
    @Author 硕鼠
    @Date 2020/4/18 19:55
    @Version 1.0
    @Description 文件说明
  -->
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.4.1.min.js"></script>
    <script>
        $(function () {
            console.log($('li').parent().html());
            console.log($('li').parents());
            console.log($('li').parentsUntil().html());
        });
    </script>
</head>
<body>
    <div>
        <ul>
            <li>java</li>
        </ul>
    </div>
</body>
</html>